package sng.net.rpc
{
	import flash.events.EventDispatcher;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.http.HTTPService;

	public class GameRPC extends EventDispatcher
	{
		private var responder:IResponder;
		private var service:HTTPService;
		
		public function GameRPC(_url:String, _responder:IResponder)
		{
			//负责http的请求
			this.service = new HTTPService();
			this.service.url = _url;
			
			//响应代理
			this.responder = _responder;
		}
		
		public function load() : void 
		{
			var token:AsyncToken = service.send();
			
			token.addResponder( responder );
		}
	}
}